Release/0.2.0#23
Merged
Merged
Conversation
added 4 commits
May 8, 2026 11:43
- src layout (src/newsdataapi/), Python 3.8-3.14, hatchling + uv - Typed exception hierarchy (NewsdataAPIError / Auth / RateLimit / Server / Network / Validation), all subclassing NewsdataException - Exponential retry backoff (~62s worst-case across 5 attempts vs old 9000s flat sleep); 429 honors Retry-After (integer-seconds and HTTP-date forms) - API key redacted in log output via _redact_url - raw_query is mutually exclusive with normal params; embedded apikey is silently dropped (client uses constructor apikey) - save_to_csv as free function (FileHandler mixin removed); returns pathlib.Path; never mutates input; uses csv.DictWriter for correct quoting - 99 mocked unit tests (responses lib) + 8 live-API integration tests (auto-skipped by default; opt in with -m integration) - New CI matrix Python 3.8-3.14 + OIDC trusted publishing workflow - Removed: setup.py, tox.ini, requirements.txt, MANIFEST.in, newsdataapi/utils.py (Py2/3 shim), legacy python-publish.yml
…ightening
- New filters per server FILTERS_MAPPING: datatype, creator, and
sentiment_score across latest_api, archive_api, market_api, count_api,
and market_count_api. Plus filling in existing-bucket coverage gaps in
archive/count (removeduplicate, sentiment, tag, region, organization).
- New _FLOAT_PARAMS frozenset and _check_float_param helper for
sentiment_score (numeric; rejects bool via int-subclass check, accepts
int alongside float).
- Count endpoints now support scroll=True. _scroll_all carries the
is_count flag through _dispatch and captures the final aggregate dict
under the merged response's "aggregate" key when the API returns
results as a dict on the final page.
- Client-side enforcement of server's HTTP 422 cases:
- size capped at 50 (paid-plan maximum); values > 50 raise
NewsdataValidationError pre-flight.
- 5 mutex groups mirrored from the server validator: q / qInTitle /
qInMeta; country / excludecountry; category / excludecategory;
language / excludelanguage; and the 3-way domain / domainurl /
excludedomain group.
- One-line docstring added to _dispatch for parity with the other
internals.
- 23 new tests covering all the above; unit suite 99 -> 122. All checks
pass on Python 3.12 and 3.14.
- size: enforce lower bound (must be in [1, 50]) - raw_query: reject keys with empty values - sentiment_score requires sentiment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.